<template>
  <div class="forgot">
    <div class="forgot-box">
      <h3>忘记密码</h3>
      <form action="forgot">
        <div class="input-box">
          <label for="email">邮箱：</label>
          <input
            type="email"
            name="email"
            id="email"
            placeholder="请输入邮箱~"
          />
        </div>
        <div class="input-box">
          <label for="code">验证码：</label>
          <input
            type="text"
            id="code"
            maxlength="6"
            placeholder="请输入6位验证码~"
          />
        </div>
        <div class="input-box">
          <label for="password">新密码：</label>
          <input
            type="password"
            id="password"
            placeholder="请输入新的登录密码~"
          />
        </div>
        <div class="input-box">
          <label for="repassword">确认密码：</label>
          <input
            type="repassword"
            id="repassword"
            placeholder="请输入确认登录密码~"
          />
        </div>
      </form>
      <div class="infobox">
        <router-link class="link" to="/login">前往登录</router-link>
        <router-link class="link" to="/register">前往注册</router-link>
      </div>
      <button type="submit" class="forgot-button">确认修改</button>
    </div>
  </div>
  <footer class="footer">
    <a href="https://beian.miit.gov.cn/" target="_blank">
      备案号: 蜀ICP备2024086875号-1
    </a>
    <div>
      <a
        href="https://www.douyin.com/user/MS4wLjABAAAAJxUIX2GMq0-rcucksrrllJj93HHnceibxk40_PWmeX0"
        target="_blank"
        >© 好大一只</a
      >
    </div>
  </footer>
</template>

<script setup lang="ts"></script>

<style lang="scss" scoped>
.forgot {
  // min-height: 100%;
  height: 100%;
  width: 100%;
  background: linear-gradient(to right, #a7e4f1 20%, #81cfe0 50%, #0083b0 80%);
  display: flex;
  justify-content: space-between;
  align-items: center;

  .decr {
    height: 100%;
    width: 60%;
    background-color: antiquewhite;
    opacity: 0.8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;

    .imgP {
      img {
        width: 100%;
        max-width: 300px;
        margin-bottom: 20px;
      }
    }

    .content {
      text-align: center;

      h1 {
        font-size: 2.5rem;
        color: #333;
        margin-bottom: 10px;
      }

      section {
        font-size: 1.25rem;
        color: #0083b0;
      }
    }
  }

  .forgot-box {
    flex: 1;
    max-width: 400px;
    padding: 20px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin: 50px auto;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;

    h3 {
      text-align: center;
      margin-bottom: 20px;
      color: #333;
      font-size: 1.5rem;
    }

    form {
      .input-box {
        margin-bottom: 15px;
        display: flex;
        align-items: center;

        label {
          flex: 0 0 80px; /* 控制 label 的固定宽度 */
          margin-right: 10px;
          color: #555;
        }

        input {
          flex: 1;
          padding: 10px;
          border: 1px solid #ddd;
          border-radius: 4px;
          outline: none;

          &:focus {
            border-color: #66afe9;
            box-shadow: 0 0 8px rgba(102, 175, 233, 0.6);
          }
        }
      }
    }

    .infobox {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;

      .el-checkbox {
        flex-shrink: 0;
      }

      .link {
        color: #409eff;
        cursor: pointer;
        transition: color 0.3s;

        &:hover {
          color: #66b1ff;
        }
      }
    }

    .forgot-button {
      width: 100%;
      padding: 10px;
      background-color: #409eff;
      border: none;
      border-radius: 4px;
      color: white;
      font-size: 16px;
      cursor: pointer;
      transition: background-color 0.3s;

      &:hover {
        background-color: #66b1ff;
      }
    }
  }

  @media (max-width: 768px) {
    flex-direction: column;
    height: 100%;
    .decr {
      display: none; // 小屏幕时隐藏描述部分
    }

    .forgot-box {
      width: 90%;
      margin: 20px auto;
      padding: 20px;
    }
  }
}
</style>
